//
//  MineTableViewCell.swift
//  FrameProduct
//
//  Created by delegate on 2025/10/22.
//

import UIKit

class MineTableViewCell: UITableViewCell {
    var model: MineModel = MineModel() {
        didSet {
            iconImageView.image = UIImage(named: model.iconStr)
            titleLabel.text = model.titleStr
        }
    }
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        backgroundColor = .clear
        selectionStyle = .none
        contentView.addSubviews(iconImageView, titleLabel, arrowImageView, subTitleLabel)
        iconImageView.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalTo(33)
            make.width.height.equalTo(17)
        }
        titleLabel.snp.makeConstraints { make in
            make.left.equalTo(iconImageView.snp.right).offset(10)
            make.centerY.equalToSuperview()
            make.height.equalTo(20)
        }
        arrowImageView.snp.makeConstraints {make in
            make.right.equalTo(-20)
            make.centerY.equalToSuperview()
            make.width.height.equalTo(32)
        }
        subTitleLabel.snp.makeConstraints { make in
            make.right.equalTo(arrowImageView.snp.left).offset(-10)
            make.centerY.equalToSuperview()
            make.height.equalTo(20)
        }
    }
    //=================================================================
    //                            lazy
    //=================================================================
    // MARK: - lazy
    private lazy var iconImageView: UIImageView = {
        let imageView = UIImageView()
        return imageView
    }()
    private lazy var arrowImageView: UIImageView = {
        let imageView = UIImageView()
        imageView.image = UIImage(named: "mine_arrow_icon")
        return imageView
    }()
    private lazy var titleLabel: UILabel = {
        let label = UILabel()
        label.text = "账号与安全"
        label.textColor = .lxs.hex("#FFFFFF")
        label.font = .lxs.font(size: 14)
        return label
    }()
    private lazy var subTitleLabel: UILabel = {
        let label = UILabel()
        label.text = ""
        label.textColor = .lxs.hex("#FFFFFF")
        label.font = .lxs.font(size: 12)
        return label
    }()
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}

extension MineTableViewCell: ReuseIdentifiable {
    static var reuseIdentifier: String {
        String(describing: self)
    }
    
    
}
